Interrupts are outside the scope of SPI; their usage is neither forbidden nor specified, and so may be implemented optionally.
From Master → Slave:
- Microcontrollers used as SPI slaves often have hardware support for:
- Receive interrupts: Triggered when data is received.
- Overflow interrupts: Triggered if receive FIFO buffer overflows.
- SS line interrupts: Triggered when Slave Select (SS) goes low or high, allowing the slave to react immediately.
From Slave → Master:
- Some SPI slaves send interrupt signals back to the master using a separate wire.
- Examples:
- Pen-down interrupt (touchscreen sensors)
- Thermal alert (temperature sensors)
- Alarm outputs (RTC chips)
- SDIO signals
- Audio jack insertion detection
- Alternative: If no interrupt pin is available, the master can poll the slave at regular intervals (similar to USB polling).